/*
 * Copyright 2012 NJUT  qixiaobo. All rights reserved.
 */
package com.fujitsu.nanjing.mobile.common;

import org.apache.log4j.Logger;

/**
 * CommonParamter.java
 * 
 * @author Qixiaobo-win8
 */
public class CommonParamter {
    /**
     * Logger for this class
     */
    private static final Logger logger = Logger.getLogger(CommonParamter.class);

    /******************** 定义常见错误码 开始 **********************/


    public static final int FAILED = -1;

    public static final int UNKNOWN_ERROR = -2;
    
    public static final int SUCCESS = 200;
    
    public static final int PASSWORD_EMPTY = 1;

    public static final int PASSWORD_ERROR = 2;

    public static final int NO_USER = 3;

    public static final int DATA_ERROR = 4;

    public static final int PASSWORD_FORMAT_ERROR = 5;

    public static final int ROLE_NO_EXIST = 6;

    public static final int NO_RECORD = 7;

    public static final int NEVER_SIGN_IN = 8;

    public static final int SIGN_IN_YET = 9;

    public static final int NEVER_SIGN_OUT = 10;

    public static final int SIGN_OUT_YET = 11;

    public static final int GPS_OUT_AREA = 12;

    public static final int NOT_YOUR_SUPERVISOR = 13;
    
    public static final int BACK_STATE = 14;
    
    public static final int NOT_SUPERVISOR = 15;
    
    public static final int SIGN_IN_YET_OR_NO_TASK = 16;
    
    public static final int SIGN_OUT_TIME_NOT_TOUCH = 17;

    /******************** 定义常见错误码 结束 **********************/

    /******************** 定义其他常量开始 **********************/

    public static final String DEFAULT_GPS = "0";
    
    public static final int MAX_RESULT = 7;

    public static  double minDistance =100.0;

    public static final String REMARK = " ";

    public static final int EVENT_SOLVED = 1;

    public static final int EVENT_SOLVEING = 2;
    
    public static final int EVENT_UNSOLVED = 3;
    
    public static final int NO_USER_RECORD = -1;
    
    public static String photoDir="/upload/photo";
    
    
    static{
        try {
            logger.info("minDistance=" + minDistance);
            minDistance = Double.parseDouble(PropertyUtils.info(Context.MIN_DISTANCE));
            photoDir=PropertyUtils.info(Context.PHOTO_DIR);
        } catch (NumberFormatException e) {
        }
        logger.info("minDistance=" + minDistance);
    }

   

    /******************** 定义其他常量 结束 **********************/
    
    public static final String DEFAULT_MSG_TITLE ="通知--新的突发事件";
    public static final String UNREAD_MESSAGE_TITLE ="接受未读消息";
    public static final String  MESSAGE_TITLE ="接受消息";
    public static final String DEFAULT_MSG_TITLE_NOTICE ="紧急通知";
    public static final String LOGIN_IN_OTHER_PLACE ="您的账户在其他地方上线了";
    
    /**
     * 属性文件枚举类
     * */
    public static enum Context{
        MIN_DISTANCE("minDistance"),PHOTO_DIR("photoDir");
        private Context(String key){
            this.key=key;
        }
        private String key;
        public String getKey(){
            return this.key;
        }
    }

}
